﻿using Awsc.DataAcquisitionSys.Core.Service.Alarm.Interfaces;
using Awsc.DataAcquisitionSys.Core.Common;

namespace Awsc.DataAcquisitionSys.Core.Service.Alarm.Implement
{
    public class AlarmMethods
    {



        private static Dictionary<string, IAlarmMethod> _allMethods = new Dictionary<string, IAlarmMethod>()
        {
            { "日志报警",LogAlarmMethod},
            { "弹窗报警",MessageBoxAlarmMethod},
            { "声光报警",SoundLightAlarmMethod}

        };
        public static IAlarmMethod LogAlarmMethod = new LogAlarmMethod() { };
        public static IAlarmMethod MessageBoxAlarmMethod = new MessageBoxAlarmMethod();
        public static IAlarmMethod SoundLightAlarmMethod = new SoundLightAlarmMethod();

        public static IAlarmMethod GetByName(string methodName)
        {
            ArgumentAssert.NotNullOrEmpty(methodName);
            if(!_allMethods.ContainsKey(methodName))
            {
                throw new NotImplementedException("methodName");
            }
            return _allMethods[methodName];
        }



    }
}
